package com.lau.dicttranslator.model;

import com.lau.dicttranslator.annotation.DictField;
import com.lau.dicttranslator.enums.DictType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lau.dicttranslator.serializer.DictFieldSerializer;
import lombok.Data;

import java.util.List;

/**
 * 用户实体示例
 */
@Data
public class User {
    
    private Long id;
    
    private String name;
    
    /**
     * 状态：使用枚举字典
     */
    @DictField(dictType = DictType.ENUM, dictCode = "com.lau.dicttranslator.enums.StatusEnum")
    @JsonSerialize(using = DictFieldSerializer.class)
    private Integer status;
    
    /**
     * 性别：使用数据库字典
     */
    @DictField(dictType = DictType.DATABASE, dictCode = "gender")
    @JsonSerialize(using = DictFieldSerializer.class)
    private String gender;
    
    /**
     * 部门ID：使用数据库字典
     */
    @DictField(dictType = DictType.DATABASE, dictCode = "department", nameSuffix = "Text")
    @JsonSerialize(using = DictFieldSerializer.class)
    private String deptId;
    
    /**
     * 用户详情（嵌套对象）
     */
    private UserDetail detail;
    
    /**
     * 用户角色列表（嵌套对象列表）
     */
    private List<UserRole> roles;
} 